package com.baifendian.common.task;

import com.baifendian.common.utils.DateUtils;
import com.baifendian.dao.entity.RcDataInterStat;
import com.baifendian.dao.entity.RcDataSysStat;
import com.baifendian.service.RcDataInterStatService;
import com.baifendian.service.RcDataSysStatService;
import java.util.Date;
import java.util.List;
import org.springframework.util.ObjectUtils;

/**
 * @author peng.guo on 2018/3/8.
 */
public class RcDataSysStatImpTask implements Runnable{

  private String name;

  private RcDataSysStatService rcDataSysStatService;

  public RcDataSysStatImpTask(RcDataSysStatService rcDataSysStatService,String name) {
    this.name = name;
    this.rcDataSysStatService = rcDataSysStatService;
  }


  @Override
  public void run() {
    Date date = DateUtils.stringToDate("02/22/2018");
    DateUtils.localDateTimeToDate(DateUtils.getCurrentTime());
    List<RcDataSysStat> rcDataSysStatList = rcDataSysStatService.getRcDataSysStatByImp();
    if(ObjectUtils.isEmpty(rcDataSysStatList)){
      return;
    }
    rcDataSysStatService.delRcDataSysStatImp();
    rcDataSysStatService.saveRcDataSysStat(rcDataSysStatList);
    System.out.println("rcApiInterStatList" + rcDataSysStatList);
  }
}
